﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ignitron.EEngine.Maths;
using GameEngine;

namespace Board3D.Animation
{
    internal class AnimationParams
    {
        Dictionary<Position, EVector3> figurePositions;
        Dictionary<Position, float> alphaColors;

        public AnimationParams()
        {
            figurePositions = new Dictionary<Position, EVector3>();
            alphaColors = new Dictionary<Position, float>();
        }


        public void Clear()
        {
            figurePositions.Clear();
            alphaColors.Clear();
        }

        public void SetPosition(Position figure, EVector3 pos)
        {
            figurePositions[figure] = pos;
        }


        public void SetAlphaColor(Position figure, float alpha)
        {
            alphaColors[figure] = alpha;
        }

        public float GetAlphaColor(Position figure)
        {
            float alpha;
            if (alphaColors.TryGetValue(figure, out alpha) == false)
                return 1;
            return alpha;
        }

        public bool ContainsAlpha(Position figure)
        {
            float dummy;
            return alphaColors.TryGetValue(figure, out dummy);
        }

        public bool GetPositionVector(Position figure, out EVector3 position)
        {
            position = EVector3.Zero;
            return figurePositions.TryGetValue(figure, out position);
        }
    }
}
